<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Block extends MY_Controller {
	public function __construct(){
		parent::__construct();
	}
	
	function add(){
		if(!empty($this->p['id'])){
			$this->_data['r'] = $this->cm->get_by_id($this->tbl->block,$this->p['id']);
		}
		$this->load->view('block/add',$this->_data);
	}

	function index(){

		$this->_data['list'] = $this->cm->get_all($this->tbl->block);
		$this->load->view('block/index',$this->_data);
	}

	function save_do(){
		$this->cm->save($this->tbl->block,$this->p);
		ejd('succ-reload','操作成功！');
	}

}

